package com.yidu.BusinessDealWith.controller;

import com.yidu.BusinessDealWith.entity.TaSettlement;
import com.yidu.BusinessDealWith.service.TaSettlementService;
import com.yidu.TAManagement.entity.TABusiness;
import com.yidu.TAManagement.service.TABusinessService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class TaSettlementController {

    @Resource
    private TaSettlementService taSettlementService;

    @RequestMapping("/selectTaSettlement")
    public Map selectTABusiness(int page, int limit, TaSettlement taSettlement){
        Map taSettlementMap=new HashMap();
        List taSettlementList = taSettlementService.selectTaSettlement(page,limit,taSettlement);
        //获取总记录数
        int count=taSettlementService.total(taSettlement);
        taSettlementMap.put("data",taSettlementList);
        taSettlementMap.put("code",0);
        taSettlementMap.put("msg","");
        taSettlementMap.put("count",count);
        return taSettlementMap;

    }
    /**
     * 修改基金
     * @param taSettlement 基金对象
     * @return 返回1 则正确 反之 则失败
     */
    @RequestMapping("/updateTaSettlement")
    public int updateTaSettlement(String taSettlement){
        System.out.println("============================================");
        System.out.println(taSettlement);
        return taSettlementService.updateTaSettlement(taSettlement);
    }

    /**
     * 修改基金
     * @param taSettlement 基金对象
     * @return 返回1 则正确 反之 则失败
     */
    @RequestMapping("/updateTaSettlementTwo")
    public int updateTaSettlementTwo(String taSettlement){
        return taSettlementService.updateTaSettlementTwo(taSettlement);
    }
}
